package com.len.util;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import java.util.*;

public class ResolverUtil {

    public static String resolve(String content){

        content = content.replace("\\8","");


        Map map = new HashMap();

        StringBuilder result = new StringBuilder();
        result.append("游戏开始信息:<br/>");
        JSONArray jsonArray = JSONObject.parseArray(content);


        for (int i=0;i<jsonArray.size();i++){
            JSONObject jsonObject = (JSONObject) jsonArray.get(i);
            if (jsonObject.getString("name").equals("v_begin_game")){//游戏开始信息
                JSONArray jsonArray1 = jsonObject.getJSONObject("args").getJSONArray("player_info");
                for (Object obj:jsonArray1){
                    JSONObject jsonObject1 = (JSONObject) obj;
                    JSONObject jsonObject2 = jsonObject1.getJSONObject("dbinfo");
                    map.put(jsonObject2.getString("id"),"");
                }
                break;
            }
        }


        for (int i=0;i<jsonArray.size();i++){
            JSONObject jsonObject = (JSONObject) jsonArray.get(i);
            if (jsonObject.getString("name").equals("deal")){
                JSONObject jsonObject1 = jsonObject.getJSONObject("args");

                int k = 0;
                for (Object obj:map.keySet()){
                    String str = (String) obj;
                    if (str.equals(jsonObject1.getString("accepter"))){
                        map.put(str,"地主");
                    }else {
                        if (k == 0){
                            k++;
                            map.put(str,"农民1");
                        }else {
                            map.put(str,"农民2");
                        }
                    }
                }
                break;
            }
        }


        for (int i=0;i<jsonArray.size();i++){
            JSONObject jsonObject = (JSONObject) jsonArray.get(i);
            if (jsonObject.getString("name").equals("v_begin_game")){//游戏开始信息
                result.append("开始时间："+DateUtil.timeStamp2Date(jsonObject.getString("time"),"yyyy-MM-dd HH:mm:ss")+"<br/>");
                result.append("玩家信息:<br/>");
                JSONArray jsonArray1 = jsonObject.getJSONObject("args").getJSONArray("player_info");
                for (Object obj:jsonArray1){
                    JSONObject jsonObject1 = (JSONObject) obj;
                    JSONObject jsonObject2 = jsonObject1.getJSONObject("dbinfo");
                    result.append("昵称："+jsonObject2.getString("nick_name")+" ");
                    result.append("游戏ID："+jsonObject2.getString("id")+" "+map.get(jsonObject2.getString("id"))+" ");
                    result.append("金币："+jsonObject2.getString("gold"));
                    result.append("<br/>");
                    result.append("手牌:");
                    JSONArray jsonArray2 = jsonObject1.getJSONArray("hand");
                    List list = jsonArray2.toJavaList(Integer.class);
                    Collections.sort(list);
                    StringBuilder sb = new StringBuilder();
                    for (int j = 0;j<list.size();j++){
                        sb.append(getDes(Integer.parseInt(list.get(j).toString())));
                        sb.append(" ");
                    }
                    result.append(sb);
                    result.append("<br/>-----------------------------------------");
                    result.append("<br/>");
                }
                break;
            }
        }


        for (int i=0;i<jsonArray.size();i++){
            JSONObject jsonObject = (JSONObject) jsonArray.get(i);
            if (jsonObject.getString("name").equals("deal")){
                JSONObject jsonObject1 = jsonObject.getJSONObject("args");

                result.append("倍数:"+jsonObject1.getString("di_bei"));
                result.append("<br/>");
//                result.append("地主ID:"+jsonObject1.getString("accepter"));

//                result.append("<br/>");
                result.append("底牌:");
                JSONArray jsonArray2 = jsonObject1.getJSONArray("card");
                List list = jsonArray2.toJavaList(Integer.class);
                Collections.sort(list);
                StringBuilder sb = new StringBuilder();
                for (int j = 0;j<list.size();j++){
                    sb.append(getDes(Integer.parseInt(list.get(j).toString())));
                    sb.append(" ");
                }
                result.append(sb);
                result.append("<br/>");
                result.append("<br/>-----------------------------------------");
                result.append("<br/>");
                result.append("开始出牌<br/>");
                result.append("=======<br/>");
                break;
            }
        }

        for (int i=0;i<jsonArray.size();i++){
            JSONObject jsonObject = (JSONObject) jsonArray.get(i);
            if (jsonObject.getString("name").equals("player_action")){
                JSONObject jsonObject1 = jsonObject.getJSONObject("args");
                result.append("出牌人:"+map.get(jsonObject1.getString("pid")));
                result.append("<br/>");
                if (jsonObject1.getString("type").equals("pass")){
                    result.append("过!");
                    result.append("<br/>");
                }else {
                    result.append("牌类型:"+getTypeDes(jsonObject1.getInteger("card_type")));
                    result.append("<br/>");
                    result.append("出的牌:");
                    result.append("<br/>");

                    JSONArray jsonArray2 = jsonObject1.getJSONArray("actioncard");
                    List list = jsonArray2.toJavaList(Integer.class);
                    Collections.sort(list);
                    StringBuilder sb = new StringBuilder();
                    for (int j = 0;j<list.size();j++){
                        sb.append(getDes(Integer.parseInt(list.get(j).toString())));
                        sb.append(" ");
                    }
                    result.append(sb);
                    result.append("<br/>");
                    result.append("实际出的牌:");
                    result.append("<br/>");

                    jsonArray2 = jsonObject1.getJSONArray("action_real_card");
                    list = jsonArray2.toJavaList(Integer.class);
                    Collections.sort(list);
                    sb = new StringBuilder();
                    for (int j = 0;j<list.size();j++){
                        sb.append(getDes(Integer.parseInt(list.get(j).toString())));
                        sb.append(" ");
                    }
                    result.append(sb);
                    result.append("<br/>");
                }
                result.append("=======<br/>");

            }
        }

        result.append("================================<br/>");
        result.append("================================<br/>");

        for (int i=0;i<jsonArray.size();i++){
            JSONObject jsonObject = (JSONObject) jsonArray.get(i);
            if (jsonObject.getString("name").equals("small_game_over")){
                result.append("打完结算：<br/>");

                JSONObject jsonObject1 = jsonObject.getJSONObject("args");
                if (jsonObject1.getBoolean("giveup")){
                    result.append("全部放弃！");
                }else {
                    JSONArray jsonArray1 = jsonObject1.getJSONArray("bills");
                    for (Object object:jsonArray1){
                        JSONObject jsonObject2 = (JSONObject) object;
                        result.append("游戏ID："+jsonObject2.getString("pid")+" "+map.get(jsonObject2.getString("pid"))+"<br/>");
                        result.append("倍数："+jsonObject2.getString("bei_shu")+"<br/>");
                        result.append("加倍信息："+getJiabeiInfo(jsonObject2.getInteger("jia_bei_info"))+"<br/>");
                        result.append("回合分变化："+jsonObject2.getString("roundscore")+"<br/>");
                        result.append("金币变化："+jsonObject2.getString("win_gold")+"<br/>");
                        result.append("总分变化："+jsonObject2.getString("score")+"<br/>");
                        result.append("剩余牌：<br/>");

                        if (jsonObject2.getString("hand").equals("{}")){
                            result.append("无剩余<br/>");
                        }else {
                            JSONArray jsonArray2 = jsonObject2.getJSONArray("hand");
                            List list = jsonArray2.toJavaList(Integer.class);
                            Collections.sort(list);
                            StringBuilder sb = new StringBuilder();
                            for (int j = 0;j<list.size();j++){
                                sb.append(getDes(Integer.parseInt(list.get(j).toString())));
                                sb.append(" ");
                            }
                            result.append(sb);
                            result.append("<br/>");
                            result.append("-----------<br/>");
                        }
                    }
                }
                break;
            }
        }

        result.append("----------------------------剧终----------------------------");

        return result.toString();
    }

//    public static void main(String[] args) {
//        System.out.println(resolve("[{\"name\":\"v_begin_game\",\"time\":1553409022,\"args\":{\"player_info\":[{\"chair\":1,\"discard\":{},\"score\":0,\"dbinfo\":{\"guan_qia_buy_num\":2,\"win_game_num\":354,\"is_shouchong\":2,\"new_play_action\":{\"id\":\"170106\",\"award_info\":[1,1,1,1,1,0],\"win_num\":66},\"is_finish_lian_sheng_challenge\":false,\"all_mei_li\":0,\"today_game_num\":0,\"month_card_end_time\":1559404800,\"boom3_num\":0,\"salvage_money_time\":0,\"is_autonym\":false,\"in_lian_sheng_challenge\":false,\"sex\":1,\"share_win_money_on_off\":true,\"last_club_type\":\"tu_hao_3\",\"jing_ding_can_buy_num\":20,\"last_lian_sheng_win\":true,\"sign_time_7\":1553443200,\"sign_time\":1553011200,\"everyday_win_L_M\":0,\"gold\":18722228,\"nick_name\":\"间愚\",\"get_max_zi_fu_num\":3,\"unionid\":\"oHj_M1H39mAxkJAf9VEyjAJQxB08\",\"guan_qia_time\":0,\"sign_num\":16,\"red_packet\":288,\"action_use_diamond_num\":0,\"active_win_num\":0,\"is_new_player\":false,\"is_get_invite_award\":false,\"daily_gift_buy\":0,\"reg_ip\":\"59.56.43.164\",\"limit_award_count\":0,\"active_win_gold\":0,\"sign_7_refresh_time\":1553443200,\"everyday_task_finish_num\":0,\"plane_num\":0,\"my_Maintain_redress_time\":1552233600,\"GQ_actions\":{\"gift_stop_buy\":[1,1,1,1],\"action_name\":\"National_Day\",\"id\":\"170106\",\"all_diamond\":0,\"everyday_recharge\":{},\"all_Recharge\":{},\"today_diamond\":0},\"props_Stop_buy\":{\"bai_zuan\":1,\"wang_wang\":1,\"chong_neng\":1},\"mouth_card_time\":1553011200,\"lian_can_revive_num\":1,\"CJ_jia_bei\":2,\"date\":0,\"id\":\"170106\",\"everyday_win_L\":0,\"vip_gift\":[0,0,0,0,0,0,0,0,0,0],\"CJJB_use_num\":0,\"everyday_task\":{\"card_type_share\":0,\"active_40\":0,\"win_100w_gold\":0,\"win_5\":0,\"active_100\":0,\"game_50\":0,\"boom3_L_3\":0,\"CJ_jia_bei_5\":0,\"active_60\":0,\"game_20\":0,\"win_10\":0,\"win_20w_gold\":0,\"game_80\":0,\"active_80\":0,\"active_20\":0,\"win_30\":0,\"boom3_L_1\":0,\"mo_bai_3\":0},\"share_win_money\":{\"update_time\":1553443200,\"get_task_num\":1,\"id\":\"170106\",\"finish_task_num\":2,\"binding_player_ids\":[{\"id\":\"105398\",\"blind_time\":1535719930},{\"id\":\"899248\",\"blind_time\":1535772669},{\"id\":\"639270\",\"blind_time\":1535773104}],\"lv2_players\":{},\"lv3_award\":0,\"begin_time\":1533794284,\"lv1_award\":0,\"lv3_award_other\":0,\"lv3_players\":{},\"lv\":0,\"lv1_players\":{},\"lv2_award\":0},\"mo_bai\":1,\"status\":1,\"phone_num\":\"13706977865\",\"lian_can_challenge_num\":3,\"last_time\":1553408971,\"cheng_hao\":0,\"diamond\":321,\"invite_code\":\"1001386444\",\"pai_wei_score\":0,\"candy_num\":0,\"duan_wei\":1,\"headimgurl\":\"http:\\/\\/thirdwx.qlogo.cn\\/mmopen\\/vi_32\\/DYAIOgq83equdHyfUdftYHR3cbzFOjSjt5Y8cp5OJqSFnSNMwny6y7jRa9YDLb2WhTmSWJpkxmXaKlYpK5102g\\/64\",\"vip_award\":[2,0,0,0,0,0,0,0,0,0],\"have_new_player_award\":false,\"pai_wei_card\":0,\"dui_huan_juan_num\":0,\"invite_player_num\":0,\"flag\":\"wx\",\"jin_ji_sai\":{},\"openid\":\"oP_vN0vEiL7ibRA1BY_NA9WxrMbU\",\"lian_sheng_challenge_num\":0,\"ji_pai_qi_chang\":1,\"reg_time\":1551596682,\"exp\":0,\"exchange_red_packet\":800,\"everyday_win_gold\":0,\"share_time\":1553011200,\"game_num\":721,\"used_diamond_num\":0,\"pai_wei_sleep\":21,\"add_red_packet\":922,\"today_mo_bai_num\":0,\"is_buy\":false,\"first_buy_diamond_info\":[0,0,0,0,0,0],\"login_time\":143,\"everyday_liveness\":0,\"vip\":1,\"already_award_money\":0,\"can_get_award_money\":0,\"everyday_win_num\":0,\"fail_number\":1,\"ji_pai_qi_tian\":9,\"everyday_task_time\":1553443200,\"jing_ding_card\":0,\"Flash_gift\":0,\"last_ip\":\"58.16.184.91\",\"everyday_share_action\":{\"value\":\"everyday\",\"win_num\":0,\"award_info\":[0,0,0],\"id\":\"170106\"},\"mouth_card_daynum\":0,\"gold_room_count\":721,\"guan_qia_use_num\":0,\"sign_num_7\":3,\"create_room_num\":1,\"all_fee\":66},\"player_bei_shu\":15,\"du_gold\":0,\"off_line\":false,\"hand\":[54,29,30,31,9,10,1,2,53,25,5,6,7,21,22,23,49],\"banned_post\":false,\"huan_state\":0,\"du_state\":0,\"limit_double\":-1,\"address\":\"贵州省安顺市西秀区黄果树大街176号+=+105.94666+=+26.238675\",\"jia_bei_info\":-1,\"isready\":true},{\"chair\":2,\"discard\":{},\"score\":0,\"dbinfo\":{\"props_Stop_buy\":{\"bai_zuan\":1,\"chong_neng\":1,\"wang_wang\":1},\"everyday_win_gold\":0,\"win_game_num\":0,\"is_shouchong\":0,\"flag\":\"tourist\",\"guan_qia_use_num\":0,\"everyday_win_L\":0,\"pai_wei_score\":0,\"dui_huan_juan_num\":8000,\"is_finish_lian_sheng_challenge\":false,\"all_mei_li\":0,\"mo_bai\":1,\"today_game_num\":0,\"nick_name\":\"自始至终都是我在无理取闹\",\"mouth_card_daynum\":0,\"plane_num\":0,\"cheng_hao\":0,\"diamond\":1000,\"everyday_task_time\":0,\"CJ_jia_bei\":0,\"guan_qia_buy_num\":0,\"duan_wei\":1,\"salvage_money_time\":0,\"jing_ding_can_buy_num\":20,\"have_new_player_award\":true,\"is_autonym\":false,\"game_num\":0,\"sex\":2,\"all_fee\":0,\"id\":\"026796\",\"first_buy_diamond_info\":[0,0,0,0,0,0,0,0,0],\"lian_can_revive_num\":1,\"ji_pai_qi_chang\":0,\"reg_time\":1553409008,\"last_lian_sheng_win\":true,\"share_time\":0,\"is_get_invite_award\":false,\"lian_can_challenge_num\":3,\"active_win_num\":0,\"sign_time\":0,\"create_room_num\":0,\"pai_wei_card\":1000,\"sign_num\":0,\"gold\":1135494,\"lian_sheng_challenge_num\":0,\"vip\":0,\"get_max_zi_fu_num\":3,\"invite_player_num\":0,\"already_award_money\":0,\"can_get_award_money\":0,\"everyday_win_num\":0,\"action_use_diamond_num\":0,\"ji_pai_qi_tian\":0,\"everyday_liveness\":0,\"jing_ding_card\":0,\"used_diamond_num\":0,\"last_ip\":\"223.78.102.167\",\"in_lian_sheng_challenge\":false,\"active_win_gold\":0,\"jin_ji_sai\":{},\"guan_qia_time\":0,\"pai_wei_sleep\":0,\"headimgurl\":\"http:\\/\\/pic.gotsoon.com\\/download\\/20170523_162425670.jpg\",\"robot\":true},\"player_bei_shu\":15,\"du_gold\":0,\"off_line\":false,\"hand\":[26,27,28,33,34,35,37,38,39,40,13,14,15,16,3,4,50],\"banned_post\":false,\"huan_state\":0,\"du_state\":0,\"limit_double\":-1,\"address\":\"未知地址+=+0+=+0\",\"jia_bei_info\":-1,\"isready\":true},{\"chair\":3,\"discard\":{},\"score\":0,\"dbinfo\":{\"props_Stop_buy\":{\"bai_zuan\":1,\"chong_neng\":1,\"wang_wang\":1},\"everyday_win_gold\":0,\"win_game_num\":0,\"is_shouchong\":0,\"flag\":\"tourist\",\"guan_qia_use_num\":0,\"everyday_win_L\":0,\"pai_wei_score\":0,\"dui_huan_juan_num\":8000,\"is_finish_lian_sheng_challenge\":false,\"all_mei_li\":0,\"mo_bai\":1,\"today_game_num\":0,\"nick_name\":\"你、我最后的保护色\",\"mouth_card_daynum\":0,\"plane_num\":0,\"cheng_hao\":0,\"diamond\":1000,\"everyday_task_time\":0,\"CJ_jia_bei\":0,\"guan_qia_buy_num\":0,\"duan_wei\":1,\"salvage_money_time\":0,\"jing_ding_can_buy_num\":20,\"have_new_player_award\":true,\"is_autonym\":false,\"game_num\":0,\"sex\":2,\"all_fee\":0,\"id\":\"025345\",\"first_buy_diamond_info\":[0,0,0,0,0,0,0,0,0],\"lian_can_revive_num\":1,\"ji_pai_qi_chang\":0,\"reg_time\":1553409008,\"last_lian_sheng_win\":true,\"share_time\":0,\"is_get_invite_award\":false,\"lian_can_challenge_num\":3,\"active_win_num\":0,\"sign_time\":0,\"create_room_num\":0,\"pai_wei_card\":1000,\"sign_num\":0,\"gold\":1344052,\"lian_sheng_challenge_num\":0,\"vip\":0,\"get_max_zi_fu_num\":3,\"invite_player_num\":0,\"already_award_money\":0,\"can_get_award_money\":0,\"everyday_win_num\":0,\"action_use_diamond_num\":0,\"ji_pai_qi_tian\":0,\"everyday_liveness\":0,\"jing_ding_card\":0,\"used_diamond_num\":0,\"last_ip\":\"123.82.45.142\",\"in_lian_sheng_challenge\":false,\"active_win_gold\":0,\"jin_ji_sai\":{},\"guan_qia_time\":0,\"pai_wei_sleep\":0,\"headimgurl\":\"http:\\/\\/pic.gotsoon.com\\/download\\/20170523_152400754.jpg\",\"robot\":true},\"player_bei_shu\":15,\"du_gold\":0,\"off_line\":false,\"hand\":[17,18,41,42,43,44,8,19,20,45,46,11,47,48,32,36,51],\"banned_post\":false,\"huan_state\":0,\"du_state\":0,\"limit_double\":-1,\"address\":\"未知地址+=+0+=+0\",\"jia_bei_info\":-1,\"isready\":true}],\"banker\":\"170106\",\"joker\":133,\"room_info\":{\"id\":\"729694\",\"owner\":\"170106\",\"voiceid\":\"xyserver_asmj729694\",\"pattern\":{\"option\":[{\"op_type\":1,\"real_name\":\"gameround\",\"name\":\"局数\",\"box\":[{\"is_choose\":true,\"text\":\"1局\",\"value\":1}]},{\"op_type\":2,\"real_name\":\"playMethod\",\"name\":\"玩法\",\"box\":[{\"is_choose\":true,\"text\":\"三带一\",\"real_name\":\"3_dai_1\"},{\"is_choose\":true,\"text\":\"三带二\",\"real_name\":\"3_dai_2\"},{\"is_choose\":true,\"text\":\"四带二\",\"real_name\":\"4_dai_2\"},{\"is_choose\":true,\"text\":\"连炸\",\"real_name\":\"lian_zha\"},{\"is_choose\":true,\"text\":\"随机首叫\",\"real_name\":\"shui_ji_di_zhu\"}]},{\"op_type\":1,\"real_name\":\"noshuffle\",\"name\":\"不洗牌\",\"box\":[{\"is_choose\":true,\"text\":\"不洗牌\",\"value\":1},{\"is_choose\":false,\"text\":\"洗牌\",\"value\":2}]},{\"op_type\":1,\"real_name\":\"laizi\",\"name\":\"癞子\",\"box\":[{\"is_choose\":true,\"text\":\"无癞子\",\"value\":0},{\"is_choose\":false,\"text\":\"普通癞子\",\"value\":1},{\"is_choose\":false,\"text\":\"天地癞子\",\"value\":2}]},{\"op_type\":1,\"real_name\":\"fengding\",\"name\":\"封顶\",\"box\":[{\"is_choose\":false,\"text\":\"16倍\",\"value\":16},{\"is_choose\":false,\"text\":\"32倍\",\"value\":32},{\"is_choose\":false,\"text\":\"64倍\",\"value\":64},{\"is_choose\":true,\"text\":\"不限倍数\",\"value\":1e+15}]}],\"name\":\"不洗牌\",\"real_name\":\"DouDiZhu_4\"}}}},{\"name\":\"deal\",\"time\":1553409022,\"args\":{\"di_bei\":3,\"accepter\":\"170106\",\"card\":[52,24,12]}},{\"name\":\"player_action\",\"time\":1553409033,\"args\":{\"card_type\":12,\"type\":\"play\",\"pid\":\"170106\",\"next_player\":\"026796\",\"time\":1553409033,\"action_real_card\":[12,10,9,7,6,2,1,5,49,52],\"actioncard\":[1,2,5,6,7,9,10,12,49,52]}},{\"name\":\"player_action\",\"time\":1553409035,\"args\":{\"card_type\":5,\"type\":\"play\",\"pid\":\"026796\",\"next_player\":\"025345\",\"time\":1553409035,\"action_real_card\":[13,14,15,16],\"actioncard\":[13,14,15,16]}},{\"name\":\"player_action\",\"time\":1553409036,\"args\":{\"card_type\":5,\"type\":\"pass\",\"pid\":\"025345\",\"next_player\":\"170106\",\"time\":1553409036,\"action_real_card\":[13,14,15,16],\"actioncard\":[13,14,15,16]}},{\"name\":\"player_action\",\"time\":1553409041,\"args\":{\"card_type\":5,\"type\":\"play\",\"pid\":\"170106\",\"next_player\":\"026796\",\"time\":1553409041,\"action_real_card\":[21,22,23,24],\"actioncard\":[21,22,23,24]}},{\"name\":\"player_action\",\"time\":1553409043,\"args\":{\"card_type\":5,\"type\":\"play\",\"pid\":\"026796\",\"next_player\":\"025345\",\"time\":1553409043,\"action_real_card\":[37,38,39,40],\"actioncard\":[37,38,39,40]}},{\"name\":\"player_action\",\"time\":1553409045,\"args\":{\"card_type\":5,\"type\":\"pass\",\"pid\":\"025345\",\"next_player\":\"170106\",\"time\":1553409045,\"action_real_card\":[37,38,39,40],\"actioncard\":[37,38,39,40]}},{\"name\":\"player_action\",\"time\":1553409046,\"args\":{\"card_type\":6,\"type\":\"play\",\"pid\":\"170106\",\"next_player\":\"026796\",\"time\":1553409046,\"action_real_card\":[53,54],\"actioncard\":[53,54]}},{\"name\":\"player_action\",\"time\":1553409047,\"args\":{\"card_type\":6,\"type\":\"pass\",\"pid\":\"026796\",\"next_player\":\"025345\",\"time\":1553409047,\"action_real_card\":[53,54],\"actioncard\":[53,54]}},{\"name\":\"player_action\",\"time\":1553409049,\"args\":{\"card_type\":15,\"type\":\"play\",\"pid\":\"025345\",\"next_player\":\"170106\",\"time\":1553409049,\"action_real_card\":[44,43,42,41,48,47,46,45],\"actioncard\":[41,42,43,44,45,46,47,48]}},{\"name\":\"player_action\",\"time\":1553409053,\"args\":{\"card_type\":15,\"type\":\"pass\",\"pid\":\"170106\",\"next_player\":\"026796\",\"time\":1553409053,\"action_real_card\":[44,43,42,41,48,47,46,45],\"actioncard\":[41,42,43,44,45,46,47,48]}},{\"name\":\"player_action\",\"time\":1553409056,\"args\":{\"card_type\":0,\"type\":\"pass\",\"pid\":\"026796\",\"next_player\":\"025345\",\"time\":1553409056,\"action_real_card\":{},\"actioncard\":{}}},{\"name\":\"player_action\",\"time\":1553409059,\"args\":{\"card_type\":1,\"type\":\"play\",\"pid\":\"025345\",\"next_player\":\"170106\",\"time\":1553409059,\"action_real_card\":[32],\"actioncard\":[32]}},{\"name\":\"player_action\",\"time\":1553409075,\"args\":{\"card_type\":1,\"type\":\"pass\",\"pid\":\"170106\",\"next_player\":\"026796\",\"time\":1553409075,\"action_real_card\":[32],\"actioncard\":[32]}},{\"name\":\"player_action\",\"time\":1553409078,\"args\":{\"card_type\":0,\"type\":\"pass\",\"pid\":\"026796\",\"next_player\":\"025345\",\"time\":1553409078,\"action_real_card\":{},\"actioncard\":{}}},{\"name\":\"player_action\",\"time\":1553409081,\"args\":{\"card_type\":1,\"type\":\"play\",\"pid\":\"025345\",\"next_player\":\"170106\",\"time\":1553409081,\"action_real_card\":[36],\"actioncard\":[36]}},{\"name\":\"player_action\",\"time\":1553409083,\"args\":{\"card_type\":1,\"type\":\"pass\",\"pid\":\"170106\",\"next_player\":\"026796\",\"time\":1553409083,\"action_real_card\":[36],\"actioncard\":[36]}},{\"name\":\"player_action\",\"time\":1553409086,\"args\":{\"card_type\":0,\"type\":\"pass\",\"pid\":\"026796\",\"next_player\":\"025345\",\"time\":1553409086,\"action_real_card\":{},\"actioncard\":{}}},{\"name\":\"player_action\",\"time\":1553409087,\"args\":{\"card_type\":1,\"type\":\"play\",\"pid\":\"025345\",\"next_player\":\"170106\",\"time\":1553409087,\"action_real_card\":[51],\"actioncard\":[51]}},{\"name\":\"player_action\",\"time\":1553409089,\"args\":{\"card_type\":1,\"type\":\"pass\",\"pid\":\"170106\",\"next_player\":\"026796\",\"time\":1553409089,\"action_real_card\":[51],\"actioncard\":[51]}},{\"name\":\"player_action\",\"time\":1553409091,\"args\":{\"card_type\":0,\"type\":\"pass\",\"pid\":\"026796\",\"next_player\":\"025345\",\"time\":1553409091,\"action_real_card\":{},\"actioncard\":{}}},{\"name\":\"player_action\",\"time\":1553409092,\"args\":{\"card_type\":13,\"type\":\"play\",\"pid\":\"025345\",\"time\":1553409092,\"action_real_card\":[20,19,18,17,11,8],\"actioncard\":[17,18,19,20,8,11]}},{\"name\":\"small_game_over\",\"time\":1553409092,\"args\":{\"giveup\":false,\"bills\":[{\"bei_shu\":8640,\"jia_bei_info\":0,\"pid\":\"170106\",\"roundscore\":-1239773,\"win_gold\":-1239773,\"hand\":[29,30,31,25],\"score\":-4147200},{\"bei_shu\":4320,\"jia_bei_info\":0,\"pid\":\"026796\",\"roundscore\":567747,\"win_gold\":567747,\"hand\":[26,27,28,33,34,35,3,4,50],\"score\":2073600},{\"bei_shu\":4320,\"jia_bei_info\":0,\"pid\":\"025345\",\"roundscore\":672026,\"win_gold\":672026,\"hand\":{},\"score\":2073600}],\"banker\":\"170106\"}}]"));
//    }

    public static String getDes(int i){
        if (i<=4){
            return "3";
        }else if (i>4&&i<=8){
            return "4";
        }else if (i>8&&i<=12){
            return "5";
        }else if (i>12&&i<=16){
            return "6";
        }else if (i>16&&i<=20){
            return "7";
        }else if (i>20&&i<=24){
            return "8";
        }else if (i>24&&i<=28){
            return "9";
        }else if (i>28&&i<=32){
            return "10";
        }else if (i>32&&i<=36){
            return "J";
        }else if (i>36&&i<=40){
            return "Q";
        }else if (i>40&&i<=44){
            return "K";
        }else if (i>44&&i<=48){
            return "A";
        }else if (i>48&&i<=52){
            return "2";
        }else if (i==53){
            return "小王";
        }else if (i==54){
            return "大王";
        }
        return "无法识别";
    }


    public static String getTypeDes(int i){
        if (i==0){
            return "未知牌型";
        }else if (i==1){
            return "单牌";
        }else if (i==2){
            return "对牌";
        }else if (i==3){
            return "三张牌";
        }else if (i==4){
            return "顺子";
        }else if (i==5){
            return "炸弹";
        }else if (i==6){
            return "王的炸弹";
        }else if (i==7){
            return "连对";
        }else if (i==8){
            return "连三张";
        }else if (i==9){
            return "三带一";
        }else if (i==10){
            return "三带二";
        }else if (i==11){
            return "飞机带单子";
        }else if (i==12){
            return "飞机带对子";
        }else if (i==13){
            return "四带二";
        }else if (i==15){
            return "连炸";
        }
        return "未知";
    }

    public static String getJiabeiInfo(int i) {
        if (i == 0) {
            return "不加倍";
        } else if (i == 1) {
            return "加倍";
        } else if (i == 2) {
            return "超级加倍";
        }
        return "未知";
    }
}
